﻿using System;
using System.ComponentModel.DataAnnotations.Schema;
using DapperExtensions.Mapper;
namespace LS.Entitys
{
    /// <summary>
    /// 消息关联表
    /// </summary>
    [Table("sys_notify")]
    public class SysNotifyEntity : EntityBase
    {

        /// <summary>
        /// 对话编号
        /// </summary>
        public string DialogueId { get; set; }
        /// <summary>
        /// 发送者编号
        /// </summary>
        public string SenderId { get; set; }
        /// <summary>
        /// 接收者编号
        /// </summary>
        public string RecipientId { get; set; }
        /// <summary>
        /// 私信内容ID
        /// </summary>
        public long ContentId { get; set; }
        /// <summary>
        /// 发送时间
        /// </summary>
        public DateTime? CreateDate { get; set; }
        /// <summary>
        /// 1=已读| 0=未读
        /// </summary>
        public bool Notifystatus { get; set; }
        /// <summary>
        /// 阅读时间    
        /// </summary>
        public DateTime? ReadDate { get; set; }

        /// <summary>
        /// 私信内容
        /// </summary>
        public string Content { get; set; }
        /// <summary>
        /// 通知类型 0=通知 1=私信 3=代办
        /// </summary>
        public int NotifyType { get; set; }

        /// <summary>
        /// 发送者名称
        /// </summary>
        public string SenderName { get; set; }

        /// <summary>
        /// 来源 工单:wo
        /// </summary>
        public string Source { get; set; }
        /// <summary>
        /// 来源id
        /// </summary>
        public string SourceId { get; set; }
    }
    public class SysNotifyEntityMapper : ClassMapper<SysNotifyEntity>
    {
        public SysNotifyEntityMapper()
        {
            Table("sys_notify");
            Map(m => m.Content).Ignore();
            Map(m => m.NotifyType).Ignore();
            Map(m => m.SenderName).Ignore();
            AutoMap();
        }
    }
}
